﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KylinORM.CQRS.Publisher;

namespace KylinORM.CQRS.Subscriber.Generic
{
    /// <summary>
    /// 泛型消息响应明细
    /// </summary>
    public class MessageHandlerItem<T> : MessageHandlerItem where T : IMessage
    {
        #region 初始化
        public MessageHandlerItem()
            :base()
        {
        }

        /// <summary>
        /// 创建消息响应明细
        /// </summary>
        /// <param name="callbackFunc"></param>
        public MessageHandlerItem(Action<T> callbackFunc)
            : base(callbackFunc)
        {
        }
        /// <summary>
        /// 创建消息响应明细
        /// </summary>
        /// <param name="callbackFunc"></param>
        /// <param name="messageType"></param>
        public MessageHandlerItem(Action<T> callbackFunc, EMessageType messageType)
            : base(callbackFunc, messageType)
        {
        }

        /// <summary>
        /// 创建消息响应明细并指定优先级
        /// </summary>
        /// <param name="callbackFunc"></param>
        /// <param name="messageLevel"></param>
        public MessageHandlerItem(Action<T> callbackFunc, EMessageLevel messageLevel)
            : base(callbackFunc, messageLevel)
        {
        }
        /// <summary>
        /// 创建消息响应明细并指定优先级
        /// </summary>
        /// <param name="callbackFunc"></param>
        /// <param name="messageType"></param>
        /// <param name="messageLevel"></param>
        public MessageHandlerItem(Action<T> callbackFunc, EMessageType messageType, EMessageLevel messageLevel)
            : base(callbackFunc, messageType, messageLevel)
        {
        }

        /// <summary>
        /// 创建消息响应明细并指定依赖条件
        /// </summary>
        /// <param name="callbackFunc"></param>
        /// <param name="handlerItems"></param>
        public MessageHandlerItem(Action<T> callbackFunc, params MessageHandlerItem[] handlerItems)
            : base(callbackFunc, handlerItems)
        {
        }
        /// <summary>
        /// 创建消息响应明细并指定依赖条件
        /// </summary>
        /// <param name="callbackFunc"></param>
        /// <param name="messageType"></param>
        /// <param name="handlerItems"></param>
        public MessageHandlerItem(Action<T> callbackFunc, EMessageType messageType, params MessageHandlerItem[] handlerItems)
            : base(callbackFunc, messageType, handlerItems)
        {
        }
        #endregion
    }
}
